package com.example.demo.dto;

import com.example.demo.model.Peer;
import com.example.demo.model.Torrent;
import com.example.demo.model.UploadDownloadHistory;
import com.fasterxml.jackson.annotation.JsonProperty;

import java.util.List;

public class TorrentDetailResponse {
    private Torrent torrent; // 存储种子信息
    private String coverImageBase64; // 存储Base64格式的封面图片

    @JsonProperty("seeders")
    private List<Peer> seeders;

    @JsonProperty("downloaders")
    private List<UploadDownloadHistory> downloaders;

    // 构造函数
    public TorrentDetailResponse(Torrent torrent, String coverImageBase64, List<Peer> seeders, List<UploadDownloadHistory> downloaders) {
        this.torrent = torrent;
        this.coverImageBase64 = coverImageBase64;
        this.seeders =  seeders;
        this.downloaders = downloaders;
    }

    // Getter和Setter
    public Torrent getTorrent() {
        return torrent;
    }

    public void setTorrent(Torrent torrent) {
        this.torrent = torrent;
    }

    public String getCoverImageBase64() {
        return coverImageBase64;
    }

    public void setCoverImageBase64(String coverImageBase64) {
        this.coverImageBase64 = coverImageBase64;
    }

    public List<Peer> getSeeders() {
        return seeders;
    }
    public void setSeeders(List<Peer> seeders) {
        this.seeders = seeders;
    }
    public List<UploadDownloadHistory> getDownloaders() {
        return downloaders;
    }
    public void setDownloaders(List<UploadDownloadHistory> downloaders) {
        this.downloaders = downloaders;
    }
}